import { DataBlocker, DataProxy } from "../../frame/A-LIB/lib.b.data";


class Status {
	/** 棋盘洗牌中 */
	shuffling: boolean;

	/** 设备ID */
	deviceID: string;

	removeTileCount: number;

	/** 游戏是否结束 */
	gameover: boolean;
	resurgence: number;

	/** 挑战人数统计值 */
	statistics_count: number;
	/** 挑战次数统计值 */
	statistics_round: number;
	/** 平均收获值 */
	statistics_free: number;

	/** 道具数量 */
	prop_stash: number;
	/** 道具数量 */
	prop_revoke: number;
	/** 道具数量 */
	prop_shuffle: number;

	guideInited: boolean;

	current_prop_type: `${'stash'|'revoke'|'shuffle'}-${'video'|'diamond'}`;
}

const blocker: DataBlocker<Status> = {
	get: {
		statistics_count(proxy, value) {
			return value??0;
		},
		statistics_round(proxy, value) {
			return value??0;
		},
		statistics_free(proxy, value) {
			return value??0;
		},
		guideInited(proxy, value) {
			return value??false;
		},
		prop_stash(proxy, value) {
			return value??0;
		},
		prop_revoke(proxy, value) {
			return value??0;
		},
		prop_shuffle(proxy, value) {
			return value??0;
		},
	}
}

export default function get_proxy_status(name?: string, prefix?: string){
	return DataProxy.initProxy(name??'status', new Status(), false, blocker, prefix??'');
}